package com.tuniu.agents.impl.trip.chain;

/**
 * Network mode enumeration
 * Used to distinguish whether to process with network connection
 */
public enum NetworkMode {
    // Offline mode: process without network connection
    OFFLINE(0),
    // Online mode: process with network connection
    ONLINE(1);

    private final int value;

    NetworkMode(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static NetworkMode fromValue(int value) {
        for (NetworkMode mode : NetworkMode.values()) {
            if (mode.getValue() == value) {
                return mode;
            }
        }
        return ONLINE; // Default return online mode
    }
} 